package com.yuelao.thread.demo;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

/**
 * Created by fengliye on 2017/10/5.
 */
public class ThreadMenu {
    public static void main(String[] args) {
        ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
        ThreadInfo[] threadArr = tmx.dumpAllThreads(false, false);
        for (ThreadInfo ti : threadArr) {
            System.out.println("[" + ti.getThreadId() + "]" + ti.getThreadName());
        }

    }
}
